/* 行动 */

//引入百度地图城市名
import { getCity } from '../../utils/baiduMap'

//同步action
export const initCity = () => {
    return { type: 'INITCITY', value: '北京' }
}

//异步action
export const initCityAsync = () => {
    return (dispatch) => {
        return getCity()
            .then(res => {
                dispatch({ type: 'INITCITY', value: res.name })
            })
    }
}